<template>
	<view class="text-page">
		<view class="main">
			<h3 class="title">{{title}}</h3>
			<view class="time">发布时间:{{time}}</view>
			<view class="text-main" v-html="html"></view>
			<view class="text-name" v-show="imgList.length!=0">领导签批</view>
			<view class="img-box" v-show="imgList.length!=0">
				<image :src="item.url" v-for="(item,index) in imgList" class="img" mode="widthFix" ></image>
			</view>
		</view>
		
	</view>
</template>

<script>
	
	export default {
		components: {},
		data() {
			return {
				title:'习近平为何在辽宁代表团问这些问题?',
				type:'student',
				html:'习近平为何在辽宁代表团问这些问题?',
				time:'2020-08-11',
				imgList:[
					
				],
			}
		},
		onLoad(obj) {
			// uni.showLoading();
			// this.getData(obj.id,obj.url);
		},
		methods: {
			getData(id,url){
				let that = this;
				this.$http.get(url+"?id="+id)
	            .then(function (response) {
	               that.title = response.data.name;
	               that.html = response.data.content;
	               that.time = response.data.createDate;
	               if(response.data.extraPhoto!="" && response.data.extraPhoto){
	               		let list = response.data.extraPhoto.split("|");
	               		let arr = [];
	               		list.forEach((item,i)=>{
	               			let obj = {};
	               			obj.url = that.$url+item;
	               			arr.push(obj)
	               		})
	               		that.imgList = arr;
	               }
	               uni.hideLoading();
	            })
	            .catch(function (error) {
	                // handle error
	                console.log(error);
	            })
			},
		}
	}
</script>

<style lang="less">
	.text-page{
		width:100%;
		height:100%;
		overflow:hidden;
		padding:0 20rpx;
		box-sizing:border-box;
		.text-name{
			width:500rpx;
			height:70rpx;
			line-height:70rpx;
			margin:0 auto;
			margin-bottom:30rpx;
			border-bottom:1px solid #dedede;
			font-size:32rpx;
			color:#555555;
			text-align:center;
		}
		.img-box{
			width:100%;
			padding:0 40rpx;
			box-sizing:border-box;
			.img{
				width:100%;
				display:block;
				margin-bottom:30rpx;
			}
		}
		.main{
			width:100%;
			height:100%;
			overflow:hidden;
			overflow-y:auto;
			.time{
				width:100%;
				text-align:center;
				line-height:60rpx;
				font-size:32rpx;
				color:#666666;
				margin:20rpx auto;
			}
			.title{
				width:100%;
				box-sizing:border-box;
				padding:0 40rpx;
				line-height:40rpx;
				font-size:36rpx;
				color:#555555;
				text-align:center;
				margin:30rpx 0;
			}
			.text-main{
				width:100%;
				line-height:40rpx;
				color:#777777;
				font-size:32rpx;
				margin-bottom:20rpx;
				img{
					max-width:100%;
					display:block;
				}
			}
		}
	}
</style>
